package com.example.moblie2021606143cwj0428;

import android.os.Bundle;
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import java.util.ArrayList;
import java.util.List;

public class MainActivity extends AppCompatActivity {

    private TextView tvMainTitle;
    private RecyclerView rvMainPart;
    private List<part> list = new ArrayList();
    private int[]partIds={R.drawable.one,R.drawable.two,R.drawable.oooo,R.drawable.zero};

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        initView();
        rvMainPart.setLayoutManager(new LinearLayoutManager(this));
        rvMainPart.setAdapter(new ParkRVAdapter(list));
        list.add(new part("潮阳区停车场","空位：48","价格：20/h","广东省汕头市潮阳区","距离：30km","更多信息",R.drawable.one));
        list.add(new part("潮南区停车场","空位：30","价格: 20/h","广东省汕头市潮南区","距离：30km","更多信息",R.drawable.two));
        list.add(new part("澄海区停车场","空位：50","价格: 20/h","广东省汕头市澄海区","距离：30km","更多信息",R.drawable.oooo));
        list.add(new part("濠江区停车场","空位：32","价格: 20/h","广东省汕头市濠江区","距离：30km","更多信息",R.drawable.zero));

    }


    private void initView() {
        tvMainTitle = findViewById(R.id.tv_main_title);
        rvMainPart = findViewById(R.id.rv_main_part);
    }


}